package org.jackysoft.entity;

import java.util.Set;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.jackysoft.util.MySqlSchema;


@Entity
@Table(name = "os_currentstep",schema=MySqlSchema.Businessbase)
public class HibernateCurrentBackStep extends HibernateStep {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4931512220715771900L;

	// ~ Constructors
	// ///////////////////////////////////////////////////////////
	public HibernateCurrentBackStep() {

	}

	public HibernateCurrentBackStep(HibernateStep step) {
		super(step);
	}

	@ElementCollection(fetch=FetchType.EAGER)
	@Cascade({CascadeType.SAVE_UPDATE,CascadeType.DELETE})
	@CollectionTable(name = "os_currentstep_prev",schema=MySqlSchema.Businessbase, joinColumns = @JoinColumn(name = "id"))
	@Column(name = "previous_id")
	public Set<Long> getPreviousSteps() {
		return super.previousSteps;
	}

	@Id	
	public long getId() {
		return id;
	}

}
